:: 测试获取输入参数
chcp 65001
goto param
:: @author mmbro
:: @since 2023-12-31 13:23:17
:: @see <a href="https://blog.csdn.net/tsvico/article/details/78050884">win7/10中以管理员身份运行bat脚本时，获取当前文件所在目录</a>

:: 获取所有参数
:: @see <a href="https://blog.csdn.net/sheji105/article/details/89011826">bat获取所有的参数</a>
:: @see <a href="https://blog.csdn.net/albertsh/article/details/52788106">.bat批处理（二）：%0 %1——给批处理脚本传递参数</a>
:param
@echo off
shift /0
echo param[0] = %0
echo param[1] = %1
echo param[2] = %2
echo param[3] = %3
echo param[4] = %4
echo param[5] = %5
goto end

:start
@echo off
set oldPath=%cd%
set aria2cPath=D:\soft\aria2c\aria2c.exe
title "正在启动Aria2c, 路径[%aria2cPath%], 参数[%allparam%]"
cd /d %~dp0
echo "%aria2cPath% %allparam%"


goto restorePath
:: 返回运行本脚本之前的目录
:restorePath
cd /d %oldPath%

:end